home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD Action 72 - Disc 2
/
cdaction-72-2.iso
/
#bonus
/
Action Mag_23.exe
/
DATA
/
intro-engine.js
< prev
next >
Wrap
Text File
|
2001-08-28
|
3KB
|
137 lines
//rozpoznanie przegladarki
function Is() {
var agent = navigator.userAgent.toLowerCase();
this.major = parseInt(navigator.appVersion);
this.minor = parseFloat(navigator.appVersion);
this.ns = ((agent.indexOf('mozilla')!=-1) && ((agent.indexOf('spoofer')==-1) && (agent.indexOf('compatible') == -1)));
this.ns2 = (this.ns && (this.major == 2));
this.ns3 = (this.ns && (this.major == 3));
this.ns4 = (this.ns && (this.major >= 4));
this.ie = (agent.indexOf("msie") != -1);
this.ie3 = (this.ie && (this.major == 2));
this.ie4 = (this.ie && (this.major >= 4));
this.op3 = (agent.indexOf("opera") != -1);
}
var is = new Is()
if(is.ns4) {
doc = "document";
sty = "";
htm = ".document"
} else if(is.ie4) {
doc = "document.all";
sty = ".style";
htm = ""
}
function preLoad()
{
ramka_Lyr = eval (doc + '["ramka_Layer"]' + sty);
ramka_Lyr.top = 170;
ramka_Lyr.left = (available_width - 320) / 2;
ramka_Lyr.visibility = "visible";
click_Lyr = eval (doc + '["click_Layer"]' + sty);
click_Lyr.top = 170;
click_Lyr.left = (available_width - 320) / 2;
click_Lyr.visibility = "visible";
amag_left_Lyr = eval (doc + '["amag_left_Layer"]' + sty);
amag_left_Lyr.top = 170 + 50;
amag_left_Lyr.left = (available_width - 320) / 2 - 126;
amag_left_Lyr.visibility = "visible";
amag_right_Lyr = eval (doc + '["amag_right_Layer"]' + sty);
amag_right_Lyr.top = 170 + 50;
amag_right_Lyr.left = (available_width - 320) / 2 + 320;
amag_right_Lyr.visibility = "visible";
zin_Lyr = eval (doc + '["zin_Layer"]' + sty);
zin_Lyr.top = 170 + 85;
zin_Lyr.left = (available_width - 310) / 2;
zin_Lyr.visibility = "visible";
cda_Lyr = eval (doc + '["cda_Layer"]' + sty);
cda_Lyr.top = 170 + 130;
cda_Lyr.left = (available_width - 141) / 2;
cda_Lyr.visibility = "visible";
animate();
}
x = 0;
klatki = 20;
//Animacja Intra
function animate()
{
if (x <= klatki)
{
aleft(x);
aright(x);
zin(x);
cda(x);
x++;
}
setTimeout("animate();",20);
}
function aleft(xx)
{
skok = 160 / klatki;
amag_left_Lyr.left = parseInt((available_width - 320) / 2 - 126 + skok * xx);
cTop = 0;
cRight = 126;
cBottom = 52;
cLeft = 126 - skok * xx;
if (is.ns4)
{
amag_left_Lyr.clip.top = cTop;
amag_left_Lyr.clip.right = cRight;
amag_left_Lyr.clip.bottom = cBottom;
amag_left_Lyr.clip.left = cLeft;
} else if (is.ie4)
{
amag_left_Lyr.clip = 'rect(' + cTop + ' ' + cRight + ' ' + cBottom + ' ' + cLeft + ')';
}
}
function aright(xx)
{
skok = 160 / klatki;
amag_right_Lyr.left = parseInt((available_width - 320) / 2 + 320 - skok * xx);
cTop = 0;
cRight = skok * xx;
cBottom = 52;
cLeft = 0;
if (is.ns4)
{
amag_right_Lyr.clip.top = cTop;
amag_right_Lyr.clip.right = cRight;
amag_right_Lyr.clip.bottom = cBottom;
amag_right_Lyr.clip.left = cLeft;
} else if (is.ie4)
{
amag_right_Lyr.clip = 'rect(' + cTop + ' ' + cRight + ' ' + cBottom + ' ' + cLeft + ')';
}
}
function zin(xx)
{
skok = 21 / klatki;
document.images["zin_img"].height = parseInt(skok*xx);
zin_Lyr.top = parseInt((170 + 85) + (10 - (xx / 2)));
}
function cda(xx)
{
skokw = 141 / klatki;
skokh = 57 / klatki;
document.images["cda_img"].width = parseInt(skokw*xx);
document.images["cda_img"].height = parseInt(skokh*xx);
}